import {Component, Input} from '@angular/core';
import {Occasion} from "../../models/occasion.model";
import {Router} from "@angular/router";

@Component({
  selector: 'app-info',
  templateUrl: './info.component.html',
  styleUrl: './info.component.css'
})
export class InfoComponent {
  @Input()
  occasion: Occasion | undefined;
  @Input()
  partUrl: string | undefined;
  constructor(private router: Router) {
  }
  navigateToDetailWithReturnUrl() {
    this.router.navigate(
      ['/lostorfinds', 'detail', this.occasion?.id],
      { queryParams: { returnUrl: this.partUrl } });
  }

}
